import React from 'react';
import { Modal, Transfer, TransferProps } from 'antd';

interface UserTransferModalProps {
  visible: boolean;
  allUsers: any[];
  targetKeys: string[];
  onChange: (keys: string[]) => void;
  onOk: () => void;
  onCancel: () => void;
}

const UserTransferModal: React.FC<UserTransferModalProps> = ({
  visible, allUsers, targetKeys, onChange, onOk, onCancel
}) => {
  return (
    <Modal
      title="分配用户"
      open={visible}
      onOk={onOk}
      onCancel={onCancel}
      width={600}
    >
      <Transfer
        dataSource={allUsers}
        targetKeys={targetKeys}
        onChange={(nextTargetKeys) => onChange(nextTargetKeys as string[])}
        render={item => item.name}
        rowKey={item => item.id}
        listStyle={{ width: 220, height: 400 }}
      />
    </Modal>
  );
};

export default UserTransferModal; 